package com.mlc.mlcwaystone;

import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public final class Mlcwaystone extends JavaPlugin {
    public static JavaPlugin instance;
    public static File file;
    public static File itemsflie;
//    public static ItemStack inititem = new ItemStack(Material.CAMPFIRE);
    public static ItemStack waystoneitem = new ItemStack(Material.ECHO_SHARD);
    @Override
    public void onEnable() {
        // Plugin startup logic

        instance = this;
        file = new File(instance.getDataFolder(),"all.yml");
        itemsflie = new File(instance.getDataFolder(),"items.yml");

        getLogger().info("\n\n\n传送石插件加载成功\n\n\n");
        Bukkit.getPluginManager().registerEvents(new Events(),this);

        ItemMeta meta = waystoneitem.getItemMeta();
        meta.setItemModel(NamespacedKey.fromString("mlc:waystone"));
        meta.setTooltipStyle(NamespacedKey.fromString("mlc:mlc"));
        meta.itemName(Component.text("传送石碑"));
        waystoneitem.setItemMeta(meta);

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
        getLogger().info("\n\n\n传送石插件卸载成功\n\n\n");
    }
}
